<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>NMEAParser: D:/Source/GitHub/NMEAParser/Software/NMEAParserLib/NMEAParserPacket.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">NMEAParser
   </div>
   <div id="projectbrief">NMEA Parser Library - Monte Variakojis @VisualGPS</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_4e9c05acfa2c3671b8618fcb95d57d96.html">Software</a></li><li class="navelem"><a class="el" href="dir_778b40b20c3cc7dd736bbc5ec44494e6.html">NMEAParserLib</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">NMEAParserPacket.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_n_m_e_a_parser_packet_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">* MIT License</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">*</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">*  Copyright (c) 2018 VisualGPS, LLC</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">*</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">*  Permission is hereby granted, free of charge, to any person obtaining a copy</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">*  of this software and associated documentation files (the &quot;Software&quot;), to deal</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">*  in the Software without restriction, including without limitation the rights</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">*  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">*  copies of the Software, and to permit persons to whom the Software is</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment">*  furnished to do so, subject to the following conditions:</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">*</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">*  The above copyright notice and this permission notice shall be included in all</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">*  copies or substantial portions of the Software.</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment">*</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment">*  THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment">*  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment">*  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment">*  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment">*  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment">*  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment">*  SOFTWARE.</span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="comment">*</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment">*/</span></div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor">#include &lt;cstddef&gt;</span></div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#include &lt;stdint.h&gt;</span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_n_m_e_a_parser_data_8h.html">NMEAParserData.h</a>&quot;</span></div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="comment">///</span></div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="comment">/// \class CNMEAParserPacket</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="comment">/// \brief This class will parse NMEA data packet and call its virtual processor methods.</span></div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="comment">///</span></div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="comment">/// Below describes the ProcessNMEABuffer() methods state machine. It&#39;s whole goal is to connect data, build a command and call ProcessRxCommand robustly. </span></div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="comment">///</span></div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="comment">/// \dot Receive Packet State Machine</span></div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="comment">///     digraph example{</span></div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="comment">///         node[fontname = Helvetica, fontsize = 10];</span></div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="comment">///         edge[fontname = Helvetica, fontsize = 10];</span></div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="comment">///</span></div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="comment">///         PARSE_STATE_SOM[label = &quot;PARSE_STATE_SOM&quot; URL = &quot;\ref ProcessRxCommand&quot;];</span></div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="comment">///         PARSE_STATE_CMD[label = &quot;PARSE_STATE_CMD&quot; URL = &quot;\ref ProcessRxCommand&quot;];</span></div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="comment">///         PARSE_STATE_DATA[label = &quot;PARSE_STATE_DATA&quot; URL = &quot;\ref ProcessRxCommand&quot;];</span></div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="comment">///         PARSE_STATE_CHECKSUM_1[label = &quot;PARSE_STATE_CHECKSUM_1&quot; URL = &quot;\ref ProcessRxCommand&quot;];</span></div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="comment">///         PARSE_STATE_CHECKSUM_2[label = &quot;PARSE_STATE_CHECKSUM_2&quot; URL = &quot;\ref ProcessRxCommand&quot;];</span></div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="comment">/// </span></div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="comment">///         ProcessRxCommand[label = &quot;Call Virtual ProcessRxCommand&quot; shape=&quot;rectangle&quot; URL = &quot;\ref ProcessRxCommand&quot;];</span></div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="comment">///</span></div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="comment">///         PARSE_STATE_SOM-&gt;PARSE_STATE_CMD[arrowhead = &quot;normal&quot;, style = &quot;solid&quot;];</span></div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="comment">///         PARSE_STATE_CMD-&gt;PARSE_STATE_DATA[arrowhead = &quot;normal&quot;, style = &quot;solid&quot;];</span></div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="comment">/// </span></div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="comment">///         PARSE_STATE_DATA-&gt;PARSE_STATE_CHECKSUM_1[arrowhead = &quot;normal&quot;, style = &quot;solid&quot;];</span></div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;<span class="comment">///         PARSE_STATE_DATA-&gt;PARSE_STATE_SOM[arrowhead = &quot;normal&quot;, style = &quot;solid&quot;, color = red, label=&quot;Checksum\nMismatch&quot;];</span></div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;<span class="comment">///         PARSE_STATE_DATA-&gt;ProcessRxCommand [arrowhead = &quot;normal&quot;, style = &quot;solid&quot;, label=&quot;Sentence With\nNo Checksum&quot;];</span></div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;<span class="comment">///         PARSE_STATE_DATA-&gt;PARSE_STATE_SOM[arrowhead = &quot;normal&quot;, style = &quot;solid&quot;, color = red, label=&quot;Buffer\nOverflow&quot;];</span></div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;<span class="comment">/// </span></div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;<span class="comment">///         PARSE_STATE_CHECKSUM_1-&gt;PARSE_STATE_CHECKSUM_2[arrowhead = &quot;normal&quot;, style = &quot;solid&quot;];</span></div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;<span class="comment">///         PARSE_STATE_CHECKSUM_2-&gt;ProcessRxCommand [arrowhead = &quot;normal&quot;, style = &quot;solid&quot;];</span></div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;<span class="comment">///         PARSE_STATE_CHECKSUM_2-&gt;PARSE_STATE_SOM [arrowhead = &quot;normal&quot;, style = &quot;solid&quot;, color = red, label=&quot;Checksum\nMismatch&quot;];</span></div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;<span class="comment">///         ProcessRxCommand-&gt;PARSE_STATE_SOM [arrowhead = &quot;normal&quot;, style = &quot;solid&quot;];</span></div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;<span class="comment">///     }</span></div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;<span class="comment">///  \enddot</span></div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;<span class="comment">///  </span></div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="class_c_n_m_e_a_parser_packet.html">   66</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_c_n_m_e_a_parser_packet.html">CNMEAParserPacket</a> {</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;</div><div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="class_c_n_m_e_a_parser_packet.html#afe77fde5b858aa74d2393ebdb9699cfc">   70</a></span>&#160;    <span class="keyword">enum</span> <a class="code" href="class_c_n_m_e_a_parser_packet.html#afe77fde5b858aa74d2393ebdb9699cfc">PARSE_STATE</a> {</div><div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="class_c_n_m_e_a_parser_packet.html#afe77fde5b858aa74d2393ebdb9699cfcacb193a6edd3d7ae47fb2e1fcb00ac4f5">   71</a></span>&#160;        <a class="code" href="class_c_n_m_e_a_parser_packet.html#afe77fde5b858aa74d2393ebdb9699cfcacb193a6edd3d7ae47fb2e1fcb00ac4f5">PARSE_STATE_SOM</a> = 0,                                                    <span class="comment">///&lt; Search for start of message</span></div><div class="line"><a name="l00072"></a><span class="lineno"><a class="line" href="class_c_n_m_e_a_parser_packet.html#afe77fde5b858aa74d2393ebdb9699cfca9165613822692f404e6b228e1444c7bb">   72</a></span>&#160;<span class="comment"></span>        <a class="code" href="class_c_n_m_e_a_parser_packet.html#afe77fde5b858aa74d2393ebdb9699cfca9165613822692f404e6b228e1444c7bb">PARSE_STATE_CMD</a>,                                                        <span class="comment">///&lt; Get command</span></div><div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="class_c_n_m_e_a_parser_packet.html#afe77fde5b858aa74d2393ebdb9699cfca95bb69da399f4dcc40d1fab5837447be">   73</a></span>&#160;<span class="comment"></span>        <a class="code" href="class_c_n_m_e_a_parser_packet.html#afe77fde5b858aa74d2393ebdb9699cfca95bb69da399f4dcc40d1fab5837447be">PARSE_STATE_DATA</a>,                                                       <span class="comment">///&lt; Get data</span></div><div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="class_c_n_m_e_a_parser_packet.html#afe77fde5b858aa74d2393ebdb9699cfcacce03973d245e26c195a2e17d1a313a2">   74</a></span>&#160;<span class="comment"></span>        <a class="code" href="class_c_n_m_e_a_parser_packet.html#afe77fde5b858aa74d2393ebdb9699cfcacce03973d245e26c195a2e17d1a313a2">PARSE_STATE_CHECKSUM_1</a>,                                                 <span class="comment">///&lt; Get first checksum character</span></div><div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="class_c_n_m_e_a_parser_packet.html#afe77fde5b858aa74d2393ebdb9699cfca5c763e8aac399dad22cc332738adb2ba">   75</a></span>&#160;<span class="comment"></span>        <a class="code" href="class_c_n_m_e_a_parser_packet.html#afe77fde5b858aa74d2393ebdb9699cfca5c763e8aac399dad22cc332738adb2ba">PARSE_STATE_CHECKSUM_2</a>,                                                 <span class="comment">///&lt; get second checksum character</span></div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;<span class="comment"></span>    };</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="class_c_n_m_e_a_parser_packet.html#acf2463f2805b2eceabe165cef3554521">   80</a></span>&#160;    <a class="code" href="class_c_n_m_e_a_parser_packet.html#afe77fde5b858aa74d2393ebdb9699cfc">PARSE_STATE</a>                     <a class="code" href="class_c_n_m_e_a_parser_packet.html#acf2463f2805b2eceabe165cef3554521">m_nState</a>;                                   <span class="comment">///&lt; Current NMEA parse state</span></div><div class="line"><a name="l00081"></a><span class="lineno"><a class="line" href="class_c_n_m_e_a_parser_packet.html#a2ccd83fa6c892e952ce9e28bb8b63d94">   81</a></span>&#160;<span class="comment"></span>    uint8_t                         <a class="code" href="class_c_n_m_e_a_parser_packet.html#a2ccd83fa6c892e952ce9e28bb8b63d94">m_u8Checksum</a>;                               <span class="comment">///&lt; Calculated NMEA sentence checksum</span></div><div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="class_c_n_m_e_a_parser_packet.html#aa20e500025c0e6d96ec3447111d0c5af">   82</a></span>&#160;<span class="comment"></span>    uint8_t                         <a class="code" href="class_c_n_m_e_a_parser_packet.html#aa20e500025c0e6d96ec3447111d0c5af">m_u8ReceivedChecksum</a>;                       <span class="comment">///&lt; Received NMEA sentence checksum (if exists)</span></div><div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="class_c_n_m_e_a_parser_packet.html#aa8b735f17e56b8404f465671f5df0248">   83</a></span>&#160;<span class="comment"></span>    uint16_t                        <a class="code" href="class_c_n_m_e_a_parser_packet.html#aa8b735f17e56b8404f465671f5df0248">m_nIndex</a>;                                   <span class="comment">///&lt; Index used for command and data</span></div><div class="line"><a name="l00084"></a><span class="lineno"><a class="line" href="class_c_n_m_e_a_parser_packet.html#a40389a7b00aed504ef6384d17e546f41">   84</a></span>&#160;<span class="comment"></span>    <span class="keywordtype">char</span>                            <a class="code" href="class_c_n_m_e_a_parser_packet.html#a40389a7b00aed504ef6384d17e546f41">m_pCommand</a>[CNMEAParserData::c_uMaxCmdLen];  <span class="comment">///&lt; NMEA command</span></div><div class="line"><a name="l00085"></a><span class="lineno"><a class="line" href="class_c_n_m_e_a_parser_packet.html#a6c2916ccc079be9da25d6446f5650214">   85</a></span>&#160;<span class="comment"></span>    <span class="keywordtype">char</span>                            <a class="code" href="class_c_n_m_e_a_parser_packet.html#a6c2916ccc079be9da25d6446f5650214">m_pData</a>[CNMEAParserData::c_uMaxDataLen];    <span class="comment">///&lt; NMEA data</span></div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    <a class="code" href="class_c_n_m_e_a_parser_packet.html#a7d991caf98d5980af0c315dc1a128ada">CNMEAParserPacket</a>();</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    <a class="code" href="class_c_n_m_e_a_parser_packet.html#a72eb9081263ab65fd5812155544e69f8">~CNMEAParserPacket</a>();</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;<span class="comment">    ///</span></div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;<span class="comment">    /// \brief Parses pData for NMEA data.</span></div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;<span class="comment">    ///</span></div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;<span class="comment">    /// This method will parse pData for NMEA data.</span></div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;<span class="comment">    /// </span></div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;<span class="comment">    /// \param pData Pointer to buffer to parse</span></div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;<span class="comment">    /// \param nBufferSize Number of bytes in pData to process.</span></div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;<span class="comment">    /// \return CNMEAParserData::ERROR_E, if successful, ERROR_OK is returned.</span></div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;<span class="comment">    ///</span></div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;<span class="comment"></span>    <a class="code" href="namespace_c_n_m_e_a_parser_data.html#a88b2365ba47855c3b8cfb7dfd71d99a9">CNMEAParserData::ERROR_E</a> <a class="code" href="class_c_n_m_e_a_parser_packet.html#a1e4e876a492b6cd7e4665081da4ac443">ProcessNMEABuffer</a>(<span class="keywordtype">char</span> *pData, <span class="keywordtype">size_t</span> nBufferSize);</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;<span class="comment">    ///</span></div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;<span class="comment">    /// \brief Reset the parser.</span></div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;<span class="comment">    ///</span></div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;<span class="comment">    /// A reset will restart the parser to start to look for the start of message.</span></div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;<span class="comment">    ///</span></div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;<span class="comment"></span>    <span class="keywordtype">void</span> <a class="code" href="class_c_n_m_e_a_parser_packet.html#a1355525f6efa8d5584f856c2b59309a3">Reset</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;<span class="comment">    ///</span></div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;<span class="comment">    /// \brief This method is called whenever there is a parsing error.</span></div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;<span class="comment">    ///</span></div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;<span class="comment">    /// Redefine this method to capture errors.</span></div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;<span class="comment">    ///</span></div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;<span class="comment">    /// \param pCmd Pointer to NMEA command that caused the error. Please note that this parameter may be NULL of not completely defined. Use with caution.</span></div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;<span class="comment">    ///</span></div><div class="line"><a name="l00116"></a><span class="lineno"><a class="line" href="class_c_n_m_e_a_parser_packet.html#acbe37d75ecda1cda2ddd3245eea6db8a">  116</a></span>&#160;<span class="comment"></span>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_c_n_m_e_a_parser_packet.html#acbe37d75ecda1cda2ddd3245eea6db8a">OnError</a>(<a class="code" href="namespace_c_n_m_e_a_parser_data.html#a88b2365ba47855c3b8cfb7dfd71d99a9">CNMEAParserData::ERROR_E</a> nError, <span class="keywordtype">char</span> *pCmd) { <a class="code" href="_n_m_e_a_parser_data_8h.html#a6c7ba74ad57863d1342878d2c703e660">UNUSED_PARAM</a>(nError); <a class="code" href="_n_m_e_a_parser_data_8h.html#a6c7ba74ad57863d1342878d2c703e660">UNUSED_PARAM</a>(pCmd);}</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;<span class="keyword">protected</span>:</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;<span class="comment">    ///</span></div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;<span class="comment">    /// \brief Redefine this method to process valid NMEA commands. Make sure that you honer the</span></div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;<span class="comment">    /// parameters below.</span></div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;<span class="comment">    ///</span></div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;<span class="comment">    /// \param pCmd Pointer to the NMEA command string</span></div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;<span class="comment">    /// \param pData Comma separated data that belongs to the command</span></div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;<span class="comment">    /// \return Returns CNMEAParserData::ERROR_OK If successful</span></div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;<span class="comment">    ///</span></div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;<span class="comment"></span>    <span class="keyword">virtual</span> <a class="code" href="namespace_c_n_m_e_a_parser_data.html#a88b2365ba47855c3b8cfb7dfd71d99a9">CNMEAParserData::ERROR_E</a> <a class="code" href="class_c_n_m_e_a_parser_packet.html#a1da7aea129ff4ca1eefb07c82df30ecf">ProcessRxCommand</a>(<span class="keywordtype">char</span> *pCmd, <span class="keywordtype">char</span> *pData) = 0;</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;<span class="comment">    ///</span></div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;<span class="comment">    /// \brief This method is called when receiving the start of message of the NMEA packet.</span></div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;<span class="comment">    ///</span></div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;<span class="comment">    /// If you need to time tag your NMEA sentences, redefine this method to allow </span></div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;<span class="comment">    /// you to capture when the SOM was received. You can then use the ProcessRxCommand()</span></div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;<span class="comment">    /// method to capture the NMEA command that this time-tag belongs to.</span></div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;<span class="comment">    ///</span></div><div class="line"><a name="l00137"></a><span class="lineno"><a class="line" href="class_c_n_m_e_a_parser_packet.html#a88297683d6572eb9134fb5fea008ee2f">  137</a></span>&#160;<span class="comment"></span>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_c_n_m_e_a_parser_packet.html#a88297683d6572eb9134fb5fea008ee2f">TimeTag</a>(<span class="keywordtype">void</span>) {}</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;};</div><div class="ttc" id="class_c_n_m_e_a_parser_packet_html_afe77fde5b858aa74d2393ebdb9699cfc"><div class="ttname"><a href="class_c_n_m_e_a_parser_packet.html#afe77fde5b858aa74d2393ebdb9699cfc">CNMEAParserPacket::PARSE_STATE</a></div><div class="ttdeci">PARSE_STATE</div><div class="ttdef"><b>Definition:</b> <a href="_n_m_e_a_parser_packet_8h_source.html#l00070">NMEAParserPacket.h:70</a></div></div>
<div class="ttc" id="class_c_n_m_e_a_parser_packet_html"><div class="ttname"><a href="class_c_n_m_e_a_parser_packet.html">CNMEAParserPacket</a></div><div class="ttdoc">This class will parse NMEA data packet and call its virtual processor methods. </div><div class="ttdef"><b>Definition:</b> <a href="_n_m_e_a_parser_packet_8h_source.html#l00066">NMEAParserPacket.h:66</a></div></div>
<div class="ttc" id="namespace_c_n_m_e_a_parser_data_html_a88b2365ba47855c3b8cfb7dfd71d99a9"><div class="ttname"><a href="namespace_c_n_m_e_a_parser_data.html#a88b2365ba47855c3b8cfb7dfd71d99a9">CNMEAParserData::ERROR_E</a></div><div class="ttdeci">ERROR_E</div><div class="ttdef"><b>Definition:</b> <a href="_n_m_e_a_parser_data_8h_source.html#l00045">NMEAParserData.h:45</a></div></div>
<div class="ttc" id="class_c_n_m_e_a_parser_packet_html_acbe37d75ecda1cda2ddd3245eea6db8a"><div class="ttname"><a href="class_c_n_m_e_a_parser_packet.html#acbe37d75ecda1cda2ddd3245eea6db8a">CNMEAParserPacket::OnError</a></div><div class="ttdeci">virtual void OnError(CNMEAParserData::ERROR_E nError, char *pCmd)</div><div class="ttdoc">This method is called whenever there is a parsing error. </div><div class="ttdef"><b>Definition:</b> <a href="_n_m_e_a_parser_packet_8h_source.html#l00116">NMEAParserPacket.h:116</a></div></div>
<div class="ttc" id="class_c_n_m_e_a_parser_packet_html_a72eb9081263ab65fd5812155544e69f8"><div class="ttname"><a href="class_c_n_m_e_a_parser_packet.html#a72eb9081263ab65fd5812155544e69f8">CNMEAParserPacket::~CNMEAParserPacket</a></div><div class="ttdeci">~CNMEAParserPacket()</div><div class="ttdef"><b>Definition:</b> <a href="_n_m_e_a_parser_packet_8cpp_source.html#l00037">NMEAParserPacket.cpp:37</a></div></div>
<div class="ttc" id="class_c_n_m_e_a_parser_packet_html_a6c2916ccc079be9da25d6446f5650214"><div class="ttname"><a href="class_c_n_m_e_a_parser_packet.html#a6c2916ccc079be9da25d6446f5650214">CNMEAParserPacket::m_pData</a></div><div class="ttdeci">char m_pData[CNMEAParserData::c_uMaxDataLen]</div><div class="ttdoc">NMEA data. </div><div class="ttdef"><b>Definition:</b> <a href="_n_m_e_a_parser_packet_8h_source.html#l00085">NMEAParserPacket.h:85</a></div></div>
<div class="ttc" id="class_c_n_m_e_a_parser_packet_html_a88297683d6572eb9134fb5fea008ee2f"><div class="ttname"><a href="class_c_n_m_e_a_parser_packet.html#a88297683d6572eb9134fb5fea008ee2f">CNMEAParserPacket::TimeTag</a></div><div class="ttdeci">virtual void TimeTag(void)</div><div class="ttdoc">This method is called when receiving the start of message of the NMEA packet. </div><div class="ttdef"><b>Definition:</b> <a href="_n_m_e_a_parser_packet_8h_source.html#l00137">NMEAParserPacket.h:137</a></div></div>
<div class="ttc" id="class_c_n_m_e_a_parser_packet_html_afe77fde5b858aa74d2393ebdb9699cfca95bb69da399f4dcc40d1fab5837447be"><div class="ttname"><a href="class_c_n_m_e_a_parser_packet.html#afe77fde5b858aa74d2393ebdb9699cfca95bb69da399f4dcc40d1fab5837447be">CNMEAParserPacket::PARSE_STATE_DATA</a></div><div class="ttdoc">Get data. </div><div class="ttdef"><b>Definition:</b> <a href="_n_m_e_a_parser_packet_8h_source.html#l00073">NMEAParserPacket.h:73</a></div></div>
<div class="ttc" id="class_c_n_m_e_a_parser_packet_html_afe77fde5b858aa74d2393ebdb9699cfca9165613822692f404e6b228e1444c7bb"><div class="ttname"><a href="class_c_n_m_e_a_parser_packet.html#afe77fde5b858aa74d2393ebdb9699cfca9165613822692f404e6b228e1444c7bb">CNMEAParserPacket::PARSE_STATE_CMD</a></div><div class="ttdoc">Get command. </div><div class="ttdef"><b>Definition:</b> <a href="_n_m_e_a_parser_packet_8h_source.html#l00072">NMEAParserPacket.h:72</a></div></div>
<div class="ttc" id="_n_m_e_a_parser_data_8h_html"><div class="ttname"><a href="_n_m_e_a_parser_data_8h.html">NMEAParserData.h</a></div></div>
<div class="ttc" id="class_c_n_m_e_a_parser_packet_html_a1355525f6efa8d5584f856c2b59309a3"><div class="ttname"><a href="class_c_n_m_e_a_parser_packet.html#a1355525f6efa8d5584f856c2b59309a3">CNMEAParserPacket::Reset</a></div><div class="ttdeci">void Reset(void)</div><div class="ttdoc">Reset the parser. </div><div class="ttdef"><b>Definition:</b> <a href="_n_m_e_a_parser_packet_8cpp_source.html#l00170">NMEAParserPacket.cpp:170</a></div></div>
<div class="ttc" id="class_c_n_m_e_a_parser_packet_html_a2ccd83fa6c892e952ce9e28bb8b63d94"><div class="ttname"><a href="class_c_n_m_e_a_parser_packet.html#a2ccd83fa6c892e952ce9e28bb8b63d94">CNMEAParserPacket::m_u8Checksum</a></div><div class="ttdeci">uint8_t m_u8Checksum</div><div class="ttdoc">Calculated NMEA sentence checksum. </div><div class="ttdef"><b>Definition:</b> <a href="_n_m_e_a_parser_packet_8h_source.html#l00081">NMEAParserPacket.h:81</a></div></div>
<div class="ttc" id="class_c_n_m_e_a_parser_packet_html_a40389a7b00aed504ef6384d17e546f41"><div class="ttname"><a href="class_c_n_m_e_a_parser_packet.html#a40389a7b00aed504ef6384d17e546f41">CNMEAParserPacket::m_pCommand</a></div><div class="ttdeci">char m_pCommand[CNMEAParserData::c_uMaxCmdLen]</div><div class="ttdoc">NMEA command. </div><div class="ttdef"><b>Definition:</b> <a href="_n_m_e_a_parser_packet_8h_source.html#l00084">NMEAParserPacket.h:84</a></div></div>
<div class="ttc" id="class_c_n_m_e_a_parser_packet_html_a1da7aea129ff4ca1eefb07c82df30ecf"><div class="ttname"><a href="class_c_n_m_e_a_parser_packet.html#a1da7aea129ff4ca1eefb07c82df30ecf">CNMEAParserPacket::ProcessRxCommand</a></div><div class="ttdeci">virtual CNMEAParserData::ERROR_E ProcessRxCommand(char *pCmd, char *pData)=0</div><div class="ttdoc">Redefine this method to process valid NMEA commands. Make sure that you honer the parameters below...</div></div>
<div class="ttc" id="_n_m_e_a_parser_data_8h_html_a6c7ba74ad57863d1342878d2c703e660"><div class="ttname"><a href="_n_m_e_a_parser_data_8h.html#a6c7ba74ad57863d1342878d2c703e660">UNUSED_PARAM</a></div><div class="ttdeci">#define UNUSED_PARAM(x)</div><div class="ttdef"><b>Definition:</b> <a href="_n_m_e_a_parser_data_8h_source.html#l00034">NMEAParserData.h:34</a></div></div>
<div class="ttc" id="class_c_n_m_e_a_parser_packet_html_a1e4e876a492b6cd7e4665081da4ac443"><div class="ttname"><a href="class_c_n_m_e_a_parser_packet.html#a1e4e876a492b6cd7e4665081da4ac443">CNMEAParserPacket::ProcessNMEABuffer</a></div><div class="ttdeci">CNMEAParserData::ERROR_E ProcessNMEABuffer(char *pData, size_t nBufferSize)</div><div class="ttdoc">Parses pData for NMEA data. </div><div class="ttdef"><b>Definition:</b> <a href="_n_m_e_a_parser_packet_8cpp_source.html#l00041">NMEAParserPacket.cpp:41</a></div></div>
<div class="ttc" id="class_c_n_m_e_a_parser_packet_html_acf2463f2805b2eceabe165cef3554521"><div class="ttname"><a href="class_c_n_m_e_a_parser_packet.html#acf2463f2805b2eceabe165cef3554521">CNMEAParserPacket::m_nState</a></div><div class="ttdeci">PARSE_STATE m_nState</div><div class="ttdoc">Current NMEA parse state. </div><div class="ttdef"><b>Definition:</b> <a href="_n_m_e_a_parser_packet_8h_source.html#l00080">NMEAParserPacket.h:80</a></div></div>
<div class="ttc" id="class_c_n_m_e_a_parser_packet_html_aa8b735f17e56b8404f465671f5df0248"><div class="ttname"><a href="class_c_n_m_e_a_parser_packet.html#aa8b735f17e56b8404f465671f5df0248">CNMEAParserPacket::m_nIndex</a></div><div class="ttdeci">uint16_t m_nIndex</div><div class="ttdoc">Index used for command and data. </div><div class="ttdef"><b>Definition:</b> <a href="_n_m_e_a_parser_packet_8h_source.html#l00083">NMEAParserPacket.h:83</a></div></div>
<div class="ttc" id="class_c_n_m_e_a_parser_packet_html_a7d991caf98d5980af0c315dc1a128ada"><div class="ttname"><a href="class_c_n_m_e_a_parser_packet.html#a7d991caf98d5980af0c315dc1a128ada">CNMEAParserPacket::CNMEAParserPacket</a></div><div class="ttdeci">CNMEAParserPacket()</div><div class="ttdef"><b>Definition:</b> <a href="_n_m_e_a_parser_packet_8cpp_source.html#l00028">NMEAParserPacket.cpp:28</a></div></div>
<div class="ttc" id="class_c_n_m_e_a_parser_packet_html_afe77fde5b858aa74d2393ebdb9699cfca5c763e8aac399dad22cc332738adb2ba"><div class="ttname"><a href="class_c_n_m_e_a_parser_packet.html#afe77fde5b858aa74d2393ebdb9699cfca5c763e8aac399dad22cc332738adb2ba">CNMEAParserPacket::PARSE_STATE_CHECKSUM_2</a></div><div class="ttdoc">get second checksum character </div><div class="ttdef"><b>Definition:</b> <a href="_n_m_e_a_parser_packet_8h_source.html#l00075">NMEAParserPacket.h:75</a></div></div>
<div class="ttc" id="class_c_n_m_e_a_parser_packet_html_afe77fde5b858aa74d2393ebdb9699cfcacce03973d245e26c195a2e17d1a313a2"><div class="ttname"><a href="class_c_n_m_e_a_parser_packet.html#afe77fde5b858aa74d2393ebdb9699cfcacce03973d245e26c195a2e17d1a313a2">CNMEAParserPacket::PARSE_STATE_CHECKSUM_1</a></div><div class="ttdoc">Get first checksum character. </div><div class="ttdef"><b>Definition:</b> <a href="_n_m_e_a_parser_packet_8h_source.html#l00074">NMEAParserPacket.h:74</a></div></div>
<div class="ttc" id="class_c_n_m_e_a_parser_packet_html_aa20e500025c0e6d96ec3447111d0c5af"><div class="ttname"><a href="class_c_n_m_e_a_parser_packet.html#aa20e500025c0e6d96ec3447111d0c5af">CNMEAParserPacket::m_u8ReceivedChecksum</a></div><div class="ttdeci">uint8_t m_u8ReceivedChecksum</div><div class="ttdoc">Received NMEA sentence checksum (if exists) </div><div class="ttdef"><b>Definition:</b> <a href="_n_m_e_a_parser_packet_8h_source.html#l00082">NMEAParserPacket.h:82</a></div></div>
<div class="ttc" id="class_c_n_m_e_a_parser_packet_html_afe77fde5b858aa74d2393ebdb9699cfcacb193a6edd3d7ae47fb2e1fcb00ac4f5"><div class="ttname"><a href="class_c_n_m_e_a_parser_packet.html#afe77fde5b858aa74d2393ebdb9699cfcacb193a6edd3d7ae47fb2e1fcb00ac4f5">CNMEAParserPacket::PARSE_STATE_SOM</a></div><div class="ttdoc">Search for start of message. </div><div class="ttdef"><b>Definition:</b> <a href="_n_m_e_a_parser_packet_8h_source.html#l00071">NMEAParserPacket.h:71</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
